package com.mz361.stdapi.repository;

import com.mz361.stdapi.domain.StandardPlan;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * @author niceale
 * @date 2023/12/06
 */
public interface StandardPlanRepository extends JpaRepository<StandardPlan, Long>, JpaSpecificationExecutor<StandardPlan> {

    StandardPlan getStandardPlanByStandardPlanNo(String tandardPlanNo);

    @Query(value = "select o.CCS from StandardPlan o")
    List<String> getCCSs();

    @Query(value = "select count(o.id) from StandardPlan o where o.CCS like concat('%',?1,'.%')")
    Long getStandardPlanLikeCcs(String ccs);


//    Page<StandardPlan> findAllByScheduledDateBetween(String start, String end, Pageable pageable);

}